<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>恩信科技</title>

  <!-- Google Font: Source Sans Pro -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/adminlte.min.css">
  <!-- overlayScrollbars -->
  <link rel="stylesheet" href="plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
</head>
<body class="hold-transition sidebar-mini layout-fixed dark-mode" data-panel-auto-height-mode="height">
<div class="wrapper">

  <!-- Navbar -->
  <nav class="main-header navbar navbar-expand navbar-dark">

    <!-- Right navbar links -->
    <ul class="navbar-nav ml-auto">
      <!-- Navbar Search -->
      <li class="nav-item">
        <a class="nav-link" data-widget="navbar-search" href="#" role="button">
          <i class="fas fa-search"></i>
        </a>
        <div class="navbar-search-block">
          <form class="form-inline">
            <div class="input-group input-group-sm">
              <input class="form-control form-control-navbar" type="search" placeholder="查询" aria-label="Search">
              <div class="input-group-append">
                <button class="btn btn-navbar" type="submit">
                  <i class="fas fa-search"></i>
                </button>
                <button class="btn btn-navbar" type="button" data-widget="navbar-search">
                  <i class="fas fa-times"></i>
                </button>
              </div>
            </div>
          </form>
        </div>
      </li>

      <li class="nav-item">
        <a class="nav-link" onclick="exit()">
          <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-escape" viewBox="0 0 16 16">
            <path d="M8.538 1.02a.5.5 0 1 0-.076.998 6 6 0 1 1-6.445 6.444.5.5 0 0 0-.997.076A7 7 0 1 0 8.538 1.02Z"/>
            <path d="M7.096 7.828a.5.5 0 0 0 .707-.707L2.707 2.025h2.768a.5.5 0 1 0 0-1H1.5a.5.5 0 0 0-.5.5V5.5a.5.5 0 0 0 1 0V2.732l5.096 5.096Z"/>
          </svg>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link" data-widget="fullscreen" href="#" role="button">
          <i class="fas fa-expand-arrows-alt"></i>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#" role="button">
          <i class="fas fa-th-large"></i>
        </a>
      </li>
    </ul>
  </nav>
  <!-- /.navbar -->

  <!-- Main Sidebar Container -->
  <aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="index3.html" class="brand-link">
      <img src="dist/img/AdminLTELogo.png" alt="恩信科技" class="brand-image img-circle elevation-3" style="opacity: .8">
      <span class="brand-text font-weight-light">恩信科技</span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
      <!-- Sidebar user panel (optional) -->
      <div class="user-panel mt-3 pb-3 mb-3 d-flex">
        <div class="image">
          <img src="dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image">
        </div>
        <div class="info">
          <a href="#" class="d-block">Alexander Pierce</a>
        </div>
      </div>

      <!-- SidebarSearch Form -->
      <div class="form-inline">
        <div class="input-group" data-widget="sidebar-search">
          <input class="form-control form-control-sidebar" type="search" placeholder="查询" aria-label="Search">
          <div class="input-group-append">
            <button class="btn btn-sidebar">
              <i class="fas fa-search fa-fw"></i>
            </button>
          </div>
        </div>
      </div>

      <!-- Sidebar Menu -->
      <nav class="mt-2">
        <ul id="menu" class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">

        </ul>
      </nav>
      <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper iframe-mode bg-dark" data-widget="iframe" data-auto-dark-mode="true" data-loading-screen="750">
    <div class="nav navbar navbar-expand-lg navbar-dark border-bottom border-dark p-0">
      <a class="nav-link bg-danger" href="#" data-widget="iframe-close">Close</a>
      <a class="nav-link bg-dark" href="#" data-widget="iframe-scrollleft"><i class="fas fa-angle-double-left"></i></a>
      <ul class="navbar-nav" role="tablist">
      </ul>
      <a class="nav-link bg-dark" href="#" data-widget="iframe-scrollright"><i class="fas fa-angle-double-right"></i></a>
      <a class="nav-link bg-dark" href="#" data-widget="iframe-fullscreen"><i class="fas fa-expand"></i></a>
    </div>
    <div class="tab-content">
      <div class="tab-empty">
        <h2 class="display-4">No tab selected!</h2>
      </div>
      <div class="tab-loading">
        <div>
          <h2 class="display-4">Tab is loading <i class="fa fa-sync fa-spin"></i></h2>
        </div>
      </div>
    </div>
  </div>
    <!-- /.content-wrapper -->

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Control sidebar content goes here -->
  </aside>
  <!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->

<!-- jQuery -->
<script src="plugins/jquery/jquery.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="plugins/jquery-ui/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
  $.widget.bridge('uibutton', $.ui.button)
</script>
<!-- Bootstrap 4 -->
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- overlayScrollbars -->
<script src="plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="dist/js/demo.js"></script>
<script>
  showMenuByUsers()
  function showMenuByUsers() {
    $.post("/SysMenus/showMenuByUsers",function (data) {
      $(data).each(function (index,item) {

        if(item.parentId==0 && item.checked){
          var li1=$("<li class='nav-item''></li>");
          var a1=$("<a class='nav-link'></a>")
          var i1;
          if(item.name=="产品设计"){
            i1=$("<i class='nav-icon fas fa-tachometer-alt'></i>")
          }else if(item.name=="生产管理"){
            i1=$("<i class='nav-icon fas fa-edit'></i>")
          }else{
            i1=$("<i class='nav-icon far fa-calendar-alt'></i>")
          }
          a1.append(i1)
          a1.append("<p>"+item.name+"<i class='right fas fa-angle-left'></i></p>")
          if(item.linkUrl!='' && item.linkUrl!=' '){
            a1.attr("href",item.linkUrl)
          }
          li1.append(a1)

          var ul1=$("<ul class='nav nav-treeview'></ul>");

          $(data).each(function (index,item2){
            if(item2.parentId==item.id && item2.checked){
              var li2=$("<li class='nav-item'></li>")
              var a2=$("<a class='nav-link'></a>")
              var i2=$("<i class='far fa-circle nav-icon'></i>")
              a2.append(i2)
              a2.append("<p>"+item2.name+"<i class='right fas fa-angle-left'></i></p>")
              if(item2.linkUrl!='' && item2.linkUrl!=' '){
                a2.attr("href",item2.linkUrl)
              }
              li2.append(a2)

              var ul2=$("<ul class='nav nav-treeview'></ul>");

              $(data).each(function (index,item3){
                if(item3.parentId==item2.id && item3.checked){
                  var li3=$("<li class='nav-item'></li>")
                  var a3=$("<a class='nav-link'></a>")
                  var i3=$("<i class='far fa-dot-circle nav-icon'></i>")
                  var p3=$("<p>"+item3.name+"</p>");
                  a3.append(i3)
                  a3.append(p3)
                  if(item3.linkUrl!='' && item3.linkUrl!=' '){
                    a3.attr("href",item3.linkUrl)
                  }
                  li3.append(a3);

                  var ul3=$("<ul class='nav nav-treeview'></ul>");
                  var a1=0;
                  $(data).each(function (index,item4){
                    if(item4.parentId==item3.id && item4.checked){
                      if(a1==0){
                        i3.removeAttr("class")
                        p3.append("<i class='right fas fa-angle-left'></i>")
                        i3.attr("class","far fa-circle nav-icon")
                        a1++;
                      }
                      var li4=$("<li class='nav-item'></li>")
                      var a4=$("<a class='nav-link'></a>")
                      var i4=$("<i class='far fa-dot-circle nav-icon'></i>")
                      var p4=$("<p>"+item4.name+"</p>");
                      a4.append(i4)
                      a4.append(p4)
                      if(item4.linkUrl!='' && item4.linkUrl!=' '){
                        a4.attr("href",item4.linkUrl)
                      }
                      li4.append(a4);
                      ul3.append(li4);
                    }
                  })
                  li3.append(ul3)
                  ul2.append(li3);
                }
              })
              li2.append(ul2);
              ul1.append(li2);
            }
          })
          li1.append(ul1);
          $("#menu").append(li1);
        }
      })
    },"json");
  }
  function exit() {
    $.post("SysUsers/exit",function (data) {
      alert(data.msg)
      window.top.location.href="../../login.html"
    })
  }
</script>
</body>
</html>
